<?php $this->import('Header') ?>
<?php $this->import('User/Top') ?>
	<div class="container">
        <div class="row home-message">
            <div class="col-xs-8 left">
                <div class="well well-sm dog-info">
                    <p class="bg-title title">我的消息</p>
                    <?php if ($message) { ?>
                        <div class="action">
                            <label>
                                <input type="checkbox" id="js-selected-all">
                                全选
                            </label>
                            <a href="javascript:;" class="del">删除</a>
                            <a href="javascript:;" class="del">标记为已读</a>
                        </div>
                        <div class="list">
                            <?php foreach ($message as $val) { ?>
                                <?php if ($val['UserId'] == $_currentUserInfo['UserId']) { ?>
                                    <div class="item">
                                        <input type="checkbox" name="messageId" value="<?php echo $val['HelloId'] ?>" />
                                        <span class="status"><?php echo $val['SendIsRead'] ? '<span class="text-capitalize">已读</span>' : '<span class="text-danger">未读</span>' ?></span>
                                        <div class="nr">
                                            <img src="<?php echo \Util\User::getUserPhoto($val['UserInfo']['Photo'], 200, 200) ?>" />
                                            <div class="if">
                                                <div>
                                                    我发送给 <a href="/dog_u<?php echo $val['ToUserId'] ?>.html"><?php echo !empty($val['UserInfo']['Username']) ? $val['UserInfo']['Username'] : $val['UserInfo']['Email'] ?></a>
                                                    <span><?php echo \Util\User::getOld($val['UserInfo']['Birthday'])?></span>
                                                    <span><?php echo implode('', $val['UserInfo']['cityInfo']) ?></span>
                                                </div>
                                                <div><?php echo \Lib\Util\Comm::diffNow($val['CreateTime']); ?>前 我给Ta发了一条问候</div>
                                            </div>
                                        </div>
                                        <a href="/home/message_<?php echo $val['HelloId'] ?>.html" class="view btn btn-default">查看详情</a>
                                    </div>
                                <?php } else { ?>
                                    <div class="item">
                                        <input type="checkbox" name="messageId" value="<?php echo $val['HelloId'] ?>" />
                                        <span class="status"><?php echo $val['IsRead'] ? '<span class="text-capitalize">已读</span>' : '<span class="text-danger">未读</span>' ?></span>
                                        <div class="nr">
                                            <img src="<?php echo \Util\User::getUserPhoto($val['UserInfo']['Photo'], 200, 200) ?>" />
                                            <div class="if">
                                                <div>
                                                    <a href="/dog_u<?php echo $val['UserId'] ?>.html"><?php echo !empty($val['UserInfo']['Username']) ? $val['UserInfo']['Username'] : $val['UserInfo']['Email'] ?></a>
                                                    <span><?php echo \Util\User::getOld($val['UserInfo']['Birthday'])?></span>
                                                    <span><?php echo implode('', $val['UserInfo']['cityInfo']) ?></span>
                                                </div>
                                                <div><?php echo \Lib\Util\Comm::diffNow($val['CreateTime']); ?>前 给你发来一条问候</div>
                                            </div>
                                        </div>
                                        <a href="/home/message_<?php echo $val['HelloId'] ?>.html" class="view btn btn-default">查看详情</a>
                                    </div>
                                <?php } ?>
                            <?php } ?>
                        </div>
                        <?php \Controller\UC\Pager::instance()->run(array('pager' => $pager)) ?>
                    <?php } else { ?>
                        <div class="list">
                            <div class="item">
                                <span>没有消息</span>
                            </div>
                        </div>
                    <?php } ?>
                </div>
            </div>
            <div class="col-xs-4 right">
                <div class="well well-sm dog-info look-me">
                    <p class="bg-title title">最近关注我的</p>
                    <div class="group">
                        <?php for ($i = 0; $i < 5; $i++) { ?>
                        <div class="item">
                            <a class="photo" href=""><img src="/Resource/images/dog_pt1.jpg"></a>
                            <div class="i">
                                <p>名字：紫薇</p>
                                <p>性别：GG</p>
                                <p>年龄：3岁</p>
                                <p>品种：金毛</p>
                                <p><a href="">3天前</a> 看过你... <a href="">看看Ta &gt;&gt;</a></p>
                            </div>
                        </div>
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
	</div>
<?php $this->import('Footer') ?>
<script>
    seajs.init();
</script>